# 导包
import unittest

from lib.HTMLTestRunner_PY3 import HTMLTestRunner
from script.test_empApi import TestEmpApi
from script.test_login_params import TestLoginParams
import app

# 1.创建测试套件对象
suite = unittest.TestSuite()

# 2.在测试套件对象中添加测试用例的类
suite.addTest(unittest.makeSuite(TestEmpApi))
suite.addTest(unittest.makeSuite(TestLoginParams))

# 3.指定测试报告存放的位置
report_path = app.BASE_PATH + "/report/report.html"

# 将测试用例执行的结果，放入测试报告中
with open(report_path,mode="wb") as f:
    # 4.实例化HTMLTestRunner对象
    runner = HTMLTestRunner(f)
    # 5.执行测试套件
    runner.run(suite)